package com.huilang.lamda.demo04;

public class DogTest {
    public static void main(String[] args) {
        Animal animal = () -> new Dag();
        System.out.println(animal.m1());

        //高级写法
        Animal dog = Dag::new;
        System.out.println(dog.m1());



        /*
        * 有参
        * */
        Animal1 animal1 = Dag::new;

        Dag 小黄 = animal1.m1("小黄", 3);
        System.out.println(小黄);

    }
}

interface Animal {
    Dag m1();
}

interface Animal1 {
    Dag m1(String name,Integer age);
}